#include <QDebug>
#include <QtPlugin>
#include "Lexers.h"
#include "DefaultLexer.h"
#include "PythonLexer.h"
#include "Jinja2Lexer.h"

namespace Lexers{

ILexer * Lexers::get(const QString & name, QObject * parent)
{
    if (name == "Default")
        return new DefaultLexer(parent);
    if (name == "Python")
        return new PythonLexer(parent);
    if (name == "jinja2 + html")
        return new Jinja2Lexer(parent);

    return NULL;
}

Lexers::~Lexers()
{
    //qDebug() << "delete lexers";
}

QStringList Lexers::names()
{
    QStringList names;
    names << "Default" << "Python" << "jinja2 + html";
    return names;
}

}

Q_EXPORT_PLUGIN2(lexers, Lexers::Lexers)
